<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>自动升级系统</title>
<link rel="shortcut icon" href="/public/Hplus/img/logo2.png">
<link href="/public/codemirror/theme/monokai.css" rel="stylesheet">
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="/public/layui/css/layui.css" rel="stylesheet">
<link href="/public/Hplus/css/style.css" rel="stylesheet">
<!-- 配置页面 -->
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
    	<div class="ibox float-e-margins">
	   		<div class="ibox-title" >
                <ol class="breadcrumb">
				  <li><a href="#">首页</a></li>
				  <li><a href="/list/ProjectListAction/query">项目</a></li>
				  <li><a href="/list/PackageListAction/query?condition.projectName=${projectName}">${projectName}</a></li>
				  <li class="active">日志</li>
				</ol>
            </div>
    		<div class="ibox-content">
    			<div class="row row-lg">
    				<div class="col-sm-12">
    				<pre id="preStr">
    				  ${str}
    				</pre>
    				</div>
    			</div>
    		</div>
    	</div>
    </div>

	<!-- 你的HTML代码 -->
	<script src="/public/javascripts/jquery-1.11.1.min.js"></script>
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<script src="/public/layui/lay/dest/layui.all.js"></script>
	
	<script src="@{'/public/autodeploy/verify.js'}"></script>
	<script type="text/javascript">
	(function(){
		 timeInt();//启动定时 
		
		//定时请求获取进度条
		 function timeInt(){
			  var tt=self.setInterval(clock, 500);
			    function clock(){
			    	var formData = new FormData();
					formData.append("condition.projectName", '${projectName}');
					formData.append("condition.logId", '${logId}');
			    	
			    	$.ajax({
				    	url:"@{log.LogAction.getProgressInfo()}",
				    	type:"POST",
				    	data:formData,
				    	processData: false,
				    	contentType: false,
				    	success:function(data){
				    		$("#preStr").html(data.result);
				    		if(data.flag){
				    			window.clearInterval(tt);
				    		}
				    	},
				    	error:function(xhr,status,error){
				    		layer.alert("网络错误");
				    		window.clearInterval(tt);
				    	}
				    });
			    }
		  }
		
		
	})()

	</script>
</body>
</html>